dim doc
set doc = application.ActiveDocument
'MAXlayer
if doc.LayerCount=250 then	
else
	Application.ExecuteCommand("Layer Setup")
	LayersSetupDlg.MaxLayers.Click()
	IncreaseMaximumLayerNumberDlg.Ok.Click()
	LayersSetupDlg.EnableDisable.Click()
	EnableDisableLayersDlg.EnableDisableLayers.SetFieldCheck(1, 2, 1)
	EnableDisableLayersDlg.Ok.Click()
	LayersSetupDlg.Ok.Click()
end if
'Default Layer
if ActiveDocument.LayerEnabled(65) then
else
	Application.ExecuteCommand("Layer Setup")
	LayersSetupDlg.EnableDisable.Click()
	EnableDisableLayersDlg.EnableDisableLayers.SetFieldCheck(1, 2, 1)
	EnableDisableLayersDlg.Ok.Click()
	LayersSetupDlg.Ok.Click()
end if

Application.ExecuteCommand("Global Options")
OptionsDlg.ActiveTab = "Dimensioning|General"
OptionsDlg.DimensioningGeneralDlg.Lines = "Layer_65"
OptionsDlg.DimensioningGeneralDlg.Text = "Layer_65"
OptionsDlg.Ok.Click()
Application.ExecuteCommand("Display Colors Setup")
DisplayColorsSetupDlg.ColorGrid.Cell("Layer_65", "#") = "1"
DisplayColorsSetupDlg.ColorGrid.ClearSelection
DisplayColorsSetupDlg.SelectedColor.SetActive (14)
DisplayColorsSetupDlg.ColorGrid.Cell("Layer_65", "2D Lines") = "14"
DisplayColorsSetupDlg.ColorGrid.Cell("Layer_65", "Text") = "14"
DisplayColorsSetupDlg.ColorGrid.Cell("Layer_65", "Copper") = "14"
DisplayColorsSetupDlg.Ok.Click()
Application.ModelessCmd("l 65")